<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
    <style>
        .box{
            display: none;
            width: 260px;
            height: 260px;
            text-align: center;
            border: 1px solid blue;
            position: relative;
        }
        .box img{
            margin-top: 30px;
        }
        .box span{
            width: 52px;
            height: 16px;
            position: absolute;
            top:3px;
            right: 2px;
            background-image:url(delete.gif);
            cursor: pointer;
        }
    </style>
</head>
<body>
<script type="text/javascript">
    function openWin(){
        var box = document.getElementById('box');//获取id为box的元素
        box.style.display='block'; //设置元素显示
    }
    function closeWin(){
        var box = document.getElementById('box');//获取id为box的元素
        box.style.display='none';//设置元素隐藏
    }
</script>
<a href="javascript:void(0)" onClick="openWin()">
    打开图片对话框</a>
<div id="box" class="box">
    <span onClick="closeWin()"></span>
    <img src="face.png">
</div>
</body>
</html>
